package com.huangguolin.cloud.api.course.service.impl;
import com.huangguolin.cloud.api.course.entity.ApiScheduleEntity;
import com.huangguolin.cloud.mybatis.entity.PtCourseEntity;
import com.huangguolin.cloud.mybatis.flexigrid.PagingEntity;
import com.huangguolin.cloud.api.course.entity.ApiCourseSearchEntity;
import com.huangguolin.cloud.api.course.repository.ApiCourseDao;
import com.huangguolin.cloud.api.course.service.ApiCourseService;
import com.huangguolin.cloud.mybatis.flexigrid.PagingEntity;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class ApiCourseServiceImpl implements ApiCourseService {
    @Resource
    private ApiCourseDao apiCourseDao;

    @Override
    public List<PtCourseEntity> queryCourseList(ApiCourseSearchEntity entity, PagingEntity paging) {
        return apiCourseDao.queryCourseList(entity,paging);
    }

    @Override
    public Integer queryCourseTotal(ApiCourseSearchEntity entity) {
        return apiCourseDao.queryCourseTotal(entity);
    }

    @Override
    public void deleteCourse(String courseUuids) {
        String[] courseIdArray = courseUuids.split(",");
        apiCourseDao.deleteCourse(courseIdArray);
    }

    @Override
    public void addCourse(String courseUuids) {
        String[] courseIdArray = courseUuids.split(",");
        apiCourseDao.addCourse(courseIdArray);

    }

    @Override
    public boolean onSubmit(ApiScheduleEntity entity) {
        return apiCourseDao.onSubmit(entity);
    }

//    @Override
//    public boolean onSubmit(String name, String radio, List<PtCourseEntity> time, List<PtCourseEntity> date, String select, String address, String remark) {
//        return apiCourseDao.onSubmit(name,radio,time,date,select,address,remark);
//    }



}
